package com.injury.hunan.entity.biz.config;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.time.DateFormatUtils;
import org.hibernate.annotations.BatchSize;

import com.injury.hunan.entity.CommonEntity;
import com.injury.hunan.entity.annotation.Comment;
import com.injury.hunan.entity.annotation.HashCodeField;
import com.injury.hunan.entity.enumu.Gender;
import com.injury.hunan.entity.enumu.ValueType;

@javax.persistence.Entity
@Table(name = "ITEM")
@BatchSize(size=20)
public class Project extends CommonEntity {

	private static final long serialVersionUID = 6567505898253652527L;

	@Id
	@Column(name = "item_code")
	@Comment("项目编码")
	@HashCodeField
	private String proCode;

	@Column(name = "item_name", nullable = false)
	@Comment("项目名称")
	@HashCodeField
	private String proName;
	
	@Column(name = "guide_no", length = 6)
	@Comment("指引单号")
	private String guideNo;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="cate_code",nullable=false)
	@Comment("类别编码")
	@HashCodeField
	private Category cateCode;

	@Column(name = "item_dw",length=20)
	@Comment("项目单位")
	private String proDw;

	@Column(name = "orderid")
	@Comment("显示顺序")
	private int order;
	
	@Column(name="gender")
	@Comment("性别")
	@Enumerated(EnumType.STRING)
	private Gender gender;

	@Column(name = "price")
	@Comment("价格")
	private Float price;
	
	@Column(name="NUMBE_TYPE")
	@Comment("数值类型")
	@Enumerated(EnumType.STRING)
	private ValueType valueType;

	@Column(name="default_result",length=200)
	@Comment("默认结果")
	private String defaultRes;

	@Column(name="refe_type",length=10)
	@Comment("参考类别")
	private String refeType;

	@Column(name = "upper_refe", precision = 5, scale = 2)
	@Comment("参考上限")
	private Float upperRefe;

	@Column(name = "lower_refe", precision = 5, scale = 2)
	@Comment("参考下限")
	private Float lowRefe;
	
	@Column(name = "refe_code", length = 20)
	@Comment("参考字符")
	private String refeCode;

	
	@Column(name = "high_tip", length = 20)
	@Comment("偏高提示")
	private String highTip;

	/**
	 * 偏低提示
	 */
	@Column(name = "lower_tip", length = 20)
	@Comment("偏低提示")
	private String lowTip;
	
	
	@Column(name = "pyjm", length = 6)
	@Comment("拼音简码")
	private String pyjm;

	@Column(name = "wbjm", length = 6)
	@Comment("五笔简码")
	private String wbjm;

	@Column(name = "zdym", length = 6)
	@Comment("自定义吗")
	private String zdym;

	@Column(name = "auto_summary")
	@Comment("是否自动小结")
	private Boolean autoSummary;

	/**
	 * 归属类别
	 */
	@Column(name = "gslb", length = 20, nullable = false)
	@Comment("伤残管理、职业康复、社会康复、辅助器械、心理咨询等")
	@HashCodeField
	private String gslb;

	@Column(name = "isgroup")
	@Comment("是否组合")
	private Boolean isGroup;

	@Column(name = "guide_tips", length = 200)
	@Comment("指引单特殊提示")
	private String guideTip;

	@Column(name = "lisflag")
	@Comment("检验标志")
	private Integer lisFlag;

	@Column(name = "pacsflag")
	@Comment("影像标志")
	private int pacsFlag;

	/**
	 * 有效标记
	 */
	@Column(name = "flag")
	@Comment("有效标记")
	private Boolean flag;

	/**
	 * 备注
	 */
	@Column(name = "demo" ,length=200)
	@Comment("备注")
	private String demo;

	@Comment("修改日期")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modify_date")
	private Date modifyDate;
	
	
	

	/**
	 * @return the proCode
	 */
	public String getProCode() {
		return proCode;
	}




	/**
	 * @param proCode the proCode to set
	 */
	public void setProCode(String proCode) {
		this.proCode = proCode;
	}




	/**
	 * @return the proName
	 */
	public String getProName() {
		return proName;
	}




	/**
	 * @param proName the proName to set
	 */
	public void setProName(String proName) {
		this.proName = proName;
	}




	/**
	 * @return the guideNo
	 */
	public String getGuideNo() {
		return guideNo;
	}




	/**
	 * @param guideNo the guideNo to set
	 */
	public void setGuideNo(String guideNo) {
		this.guideNo = guideNo;
	}




	/**
	 * @return the cateCode
	 */
	public Category getCateCode() {
		return cateCode;
	}




	/**
	 * @param cateCode the cateCode to set
	 */
	public void setCateCode(Category cateCode) {
		this.cateCode = cateCode;
	}




	/**
	 * @return the proDw
	 */
	public String getProDw() {
		return proDw;
	}




	/**
	 * @param proDw the proDw to set
	 */
	public void setProDw(String proDw) {
		this.proDw = proDw;
	}




	/**
	 * @return the order
	 */
	public int getOrder() {
		return order;
	}




	/**
	 * @param order the order to set
	 */
	public void setOrder(int order) {
		this.order = order;
	}




	/**
	 * @return the gender
	 */
	public Gender getGender() {
		return gender;
	}




	/**
	 * @param gender the gender to set
	 */
	public void setGender(Gender gender) {
		this.gender = gender;
	}




	/**
	 * @return the price
	 */
	public Float getPrice() {
		return price;
	}




	/**
	 * @param price the price to set
	 */
	public void setPrice(Float price) {
		this.price = price;
	}




	/**
	 * @return the valueType
	 */
	public ValueType getValueType() {
		return valueType;
	}




	/**
	 * @param valueType the valueType to set
	 */
	public void setValueType(ValueType valueType) {
		this.valueType = valueType;
	}




	/**
	 * @return the defaultRes
	 */
	public String getDefaultRes() {
		return defaultRes;
	}




	/**
	 * @param defaultRes the defaultRes to set
	 */
	public void setDefaultRes(String defaultRes) {
		this.defaultRes = defaultRes;
	}




	/**
	 * @return the refeType
	 */
	public String getRefeType() {
		return refeType;
	}




	/**
	 * @param refeType the refeType to set
	 */
	public void setRefeType(String refeType) {
		this.refeType = refeType;
	}




	/**
	 * @return the upperRefe
	 */
	public Float getUpperRefe() {
		return upperRefe;
	}




	/**
	 * @param upperRefe the upperRefe to set
	 */
	public void setUpperRefe(Float upperRefe) {
		this.upperRefe = upperRefe;
	}




	/**
	 * @return the lowRefe
	 */
	public Float getLowRefe() {
		return lowRefe;
	}




	/**
	 * @param lowRefe the lowRefe to set
	 */
	public void setLowRefe(Float lowRefe) {
		this.lowRefe = lowRefe;
	}




	/**
	 * @return the refeCode
	 */
	public String getRefeCode() {
		return refeCode;
	}




	/**
	 * @param refeCode the refeCode to set
	 */
	public void setRefeCode(String refeCode) {
		this.refeCode = refeCode;
	}




	/**
	 * @return the highTip
	 */
	public String getHighTip() {
		return highTip;
	}




	/**
	 * @param highTip the highTip to set
	 */
	public void setHighTip(String highTip) {
		this.highTip = highTip;
	}




	/**
	 * @return the lowTip
	 */
	public String getLowTip() {
		return lowTip;
	}




	/**
	 * @param lowTip the lowTip to set
	 */
	public void setLowTip(String lowTip) {
		this.lowTip = lowTip;
	}




	/**
	 * @return the pyjm
	 */
	public String getPyjm() {
		return pyjm;
	}




	/**
	 * @param pyjm the pyjm to set
	 */
	public void setPyjm(String pyjm) {
		this.pyjm = pyjm;
	}




	/**
	 * @return the wbjm
	 */
	public String getWbjm() {
		return wbjm;
	}




	/**
	 * @param wbjm the wbjm to set
	 */
	public void setWbjm(String wbjm) {
		this.wbjm = wbjm;
	}




	/**
	 * @return the zdym
	 */
	public String getZdym() {
		return zdym;
	}




	/**
	 * @param zdym the zdym to set
	 */
	public void setZdym(String zdym) {
		this.zdym = zdym;
	}




	/**
	 * @return the autoSummary
	 */
	public Boolean getAutoSummary() {
		return autoSummary;
	}




	/**
	 * @param autoSummary the autoSummary to set
	 */
	public void setAutoSummary(Boolean autoSummary) {
		this.autoSummary = autoSummary;
	}




	/**
	 * @return the gslb
	 */
	public String getGslb() {
		return gslb;
	}




	/**
	 * @param gslb the gslb to set
	 */
	public void setGslb(String gslb) {
		this.gslb = gslb;
	}




	/**
	 * @return the isGroup
	 */
	public Boolean getIsGroup() {
		return isGroup;
	}




	/**
	 * @param isGroup the isGroup to set
	 */
	public void setIsGroup(Boolean isGroup) {
		this.isGroup = isGroup;
	}




	/**
	 * @return the guideTip
	 */
	public String getGuideTip() {
		return guideTip;
	}




	/**
	 * @param guideTip the guideTip to set
	 */
	public void setGuideTip(String guideTip) {
		this.guideTip = guideTip;
	}




	/**
	 * @return the lisFlag
	 */
	public Integer getLisFlag() {
		return lisFlag;
	}




	/**
	 * @param lisFlag the lisFlag to set
	 */
	public void setLisFlag(Integer lisFlag) {
		this.lisFlag = lisFlag;
	}




	/**
	 * @return the pacsFlag
	 */
	public int getPacsFlag() {
		return pacsFlag;
	}




	/**
	 * @param pacsFlag the pacsFlag to set
	 */
	public void setPacsFlag(int pacsFlag) {
		this.pacsFlag = pacsFlag;
	}




	/**
	 * @return the flag
	 */
	public Boolean getFlag() {
		return flag;
	}




	/**
	 * @param flag the flag to set
	 */
	public void setFlag(Boolean flag) {
		this.flag = flag;
	}




	/**
	 * @return the demo
	 */
	public String getDemo() {
		return demo;
	}




	/**
	 * @param demo the demo to set
	 */
	public void setDemo(String demo) {
		this.demo = demo;
	}




	/**
	 * @return the modifyDate
	 */
	public Date getModifyDate() {
		return modifyDate;
	}




	/**
	 * @param modifyDate the modifyDate to set
	 */
	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}




	public Map<String, Object> toMap() {
		Map<String, Object> map = new HashMap<String, Object>();
		/*map.put("id", getId());*/
		map.put("proCode", proCode);
		map.put("proName", proName);
		map.put("guideNo", guideNo);
		map.put("cateCode", cateCode);
		map.put("proDw", proDw);
		map.put("order", order);
		map.put("price", price);
		map.put("valueType", valueType);
		map.put("defaultRes", defaultRes);
		map.put("refeType", refeType);
		map.put("upperRefe", upperRefe);
		map.put("lowRefe", lowRefe);
		map.put("refeCode", refeCode);
		map.put("highTip", highTip);
		map.put("lowTip", lowTip);
		map.put("wbjm", wbjm);
		map.put("pyjm", pyjm);
		map.put("zdym", zdym);
		map.put("autoSummary", autoSummary);
		map.put("gslb", gslb);
		map.put("isGroup", isGroup);
		map.put("guideTip", guideTip);
		map.put("lisFlag", lisFlag);
		map.put("pacsFlag", pacsFlag);
		map.put("flag", flag);
		map.put("demo", demo);
		map.put("modifyDate",
				DateFormatUtils.format(modifyDate, "yyyy-MM-dd HH:mm:ss"));
		return map;
	}

}
